<template>
 <form-create
          :rule="rule"
          :option="rule"
          @submit="onSubmit"
        ></form-create>

</template>
<script setup name="propertiesList">
//import { getDataByid} from "你的接口所在位置";
const route = useRoute();
const id = ref(route.params.id);
const rule = ref();
const options = ref();
/** 查询设计表单数据 */
function getData() {
  const aa = {
    "rule": "[{\"type\":\"tableForm\",\"field\":\"Fg1xm6vlrod0abc\",\"title\":\"\",\"info\":\"\",\"props\":{\"columns\":[{\"label\":\"名称\",\"required\":true,\"style\":{\"width\":\"auto\"},\"rule\":[{\"type\":\"input\",\"field\":\"Fxj5m6vlrthgakc\",\"title\":\"输入框\",\"info\":\"\",\"$required\":true,\"_fc_id\":\"id_F8nrm6vlrthgalc\",\"name\":\"ref_Fqifm6vlrthgamc\",\"display\":true,\"hidden\":false,\"_fc_drag_tag\":\"input\"}]},{\"label\":\"是否合格\",\"required\":true,\"style\":{\"width\":\"auto\"},\"rule\":[{\"type\":\"radio\",\"field\":\"Fa8om6vlruz7anc\",\"title\":\"单选框\",\"info\":\"\",\"effect\":{\"fetch\":\"\"},\"$required\":false,\"options\":[{\"label\":\"合格\",\"value\":\"1\"},{\"label\":\"不合格\",\"value\":\"2\"}],\"_fc_id\":\"id_F2bam6vlruz7aoc\",\"name\":\"ref_Fm7jm6vlruz7apc\",\"display\":true,\"hidden\":false,\"_fc_drag_tag\":\"radio\"}]},{\"label\":\"批次\",\"required\":true,\"style\":{\"width\":\"auto\"},\"rule\":[{\"type\":\"checkbox\",\"field\":\"F456m6vlrw4kaqc\",\"title\":\"多选框\",\"info\":\"\",\"effect\":{\"fetch\":\"\"},\"$required\":false,\"options\":[{\"label\":\"1\",\"value\":\"1\"},{\"label\":\"2\",\"value\":\"2\"},{\"label\":\"3\",\"value\":\"3\"}],\"_fc_id\":\"id_Fosfm6vlrw4karc\",\"name\":\"ref_Fq3wm6vlrw4kasc\",\"display\":true,\"hidden\":false,\"_fc_drag_tag\":\"checkbox\"}]}]},\"_fc_id\":\"id_Fav2m6vlrod0acc\",\"name\":\"ref_Fqcfm6vmsvq6aoc\",\"display\":true,\"hidden\":false,\"_fc_drag_tag\":\"tableForm\"}]",
    "options": "{\"form\":{\"inline\":false,\"hideRequiredAsterisk\":false,\"labelPosition\":\"right\",\"size\":\"default\",\"labelWidth\":\"125px\"},\"language\":{},\"resetBtn\":{\"show\":false,\"innerText\":\"重置\"},\"submitBtn\":{\"show\":true,\"innerText\":\"提交\"}}"
}
rule.value = formCreate.parseJson(aa.rule);
options.value = formCreate.parseJson(aa.options);
//   fapi.value = JSON.parse(aa);
  //   getDataByid(id.value).then((res) => {
  //     ruleBuildz.value = formCreate.parseJson(res.data.ruleBuild);
  //     optionBuildz.value = formCreate.parseJson(res.data.optionBuild);
  //     fapi.value = JSON.parse(res.data.value);
  //   });
}
/** 表单修改提交 */
function onSubmit(data) {
    console.log(data);
//   form.value.value = JSON.stringify(fapi.value);
  //   updateFromData(form.value).then((res) => {
  //     if (res.code == 200) {
  //       proxy.$modal.msgSuccess("修改成功！");
  //       designerUpdateOpen.value = false;
  //     }
  //   });
}
getData();
</script>
